package com.cskaoyan.service.wx;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.GenericData;
import com.cskaoyan.bean.po.MarketOrder;
import com.cskaoyan.bean.po.MarketOrderGoods;
import com.cskaoyan.bean.wx.order.OrderCommentBo;
import com.cskaoyan.bean.wx.order.OrderDetailVo;
import com.cskaoyan.bean.wx.order.WxMarketOrderVo;
import com.cskaoyan.bean.wx.order.WxOrderSubmitBo;
import com.cskaoyan.config.exception.LoginAuthenException;

/**
 * @author LiangRuiJiang
 * @since 2022/06/08  14:26
 */

public interface WxOrderService {

    /**
     * 查询订单
     * @param showType
     * @param page
     * @param limit
     * @param userId
     * @return
     */
    GenericData<WxMarketOrderVo> queryOrderList(Short showType, Integer page, Integer limit, Integer userId);

    /**
     * 查询对应商品细节信息
     * @param orderId
     * @param userId
     * @return
     */
    OrderDetailVo queryOrderDetail(Integer orderId, Integer userId);

    /**
     * 更新订单状态
     * @param orderId
     * @param methodName
     */
    void UpdateOrderStatus(Integer orderId, String methodName);

    /**
     * 创建售后记录
     * @param orderId
     */
    void createAfterSaleRecord(Integer orderId);

    /**
     * 付款后生成订单
     * @param wxOrderSubmitBo
     * @return
     */
    BaseRespVo insertOrder(WxOrderSubmitBo wxOrderSubmitBo) throws LoginAuthenException;

    /**
     * 付款成功改变订单状态
     * @param marketOrder
     */
    void update(MarketOrder marketOrder);
    /**
     * 查找订单，商品关系表
     * @param orderId
     * @param goodsId
     * @return
     */
    MarketOrderGoods queryOrderGoods(Integer orderId, Integer goodsId);

    /**
     * 创建订单评论
     * @param orderCommentBo
     */
    void createOrderComment(OrderCommentBo orderCommentBo,Integer userId);

    /**
     * 逻辑删除订单
     * @param orderId
     */
    void deleteOrder(Integer orderId);

    /**
     * 未付款订单，取消订单
     * @param orderId
     */
    void cancelOrder(Integer orderId);
}
